package cn.alpha.workflow.vo;

import java.io.Serializable;
import java.util.List;

/**DataTable的请求参数 */
public class DTRequestParam implements Serializable {

	private static final long serialVersionUID = 1L;

	//绘制计数器。确保Ajax从服务器返回的是对应的（Ajax是异步的,返回的顺序是不确定的）。 要求在服务器接收到此参数后再返回
	protected Integer draw;
	//第一条数据的起始位置，比如0代表第一条数据
	protected Integer start;
	//服务器每页显示的条数，-1：返回全部数据
	protected Integer length;
	//全局的搜索条件
	protected Search search;
	//定义了多少列要被排序
	protected List<Order> order;
	//定了这个表格里所有的列
	protected List<Column> columns;
	
	public static class Column{
		private String data;
		private String name;
		private boolean searchable;
		private boolean orderable;
		private Search search;
		public String getData() {
			return data;
		}
		public void setData(String data) {
			this.data = data;
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public boolean isSearchable() {
			return searchable;
		}
		public void setSearchable(boolean searchable) {
			this.searchable = searchable;
		}
		public boolean isOrderable() {
			return orderable;
		}
		public void setOrderable(boolean orderable) {
			this.orderable = orderable;
		}
		public Search getSearch() {
			return search;
		}
		public void setSearch(Search search) {
			this.search = search;
		}
	}
	public static class Order{
		private Integer column;
		private String dir;	//desc 降序 asc升序
		public Integer getColumn() {
			return column;
		}
		public void setColumn(Integer column) {
			this.column = column;
		}
		public String getDir() {
			return dir;
		}
		public void setDir(String dir) {
			this.dir = dir;
		}
		
	}
	public static class Search{
		//搜索条件
		private String value;
		//true:value值是作为正则表达式处理，为 false则不是
		private boolean regex;	
		public String getValue() {
			return value;
		}
		public void setValue(String value) {
			this.value = value;
		}
		public boolean isRegex() {
			return regex;
		}
		public void setRegex(boolean regex) {
			this.regex = regex;
		}
	}
	public Integer getDraw() {
		return draw;
	}
	public void setDraw(Integer draw) {
		this.draw = draw;
	}
	public Search getSearch() {
		return search;
	}
	public void setSearch(Search search) {
		this.search = search;
	}
	public List<Order> getOrder() {
		return order;
	}
	public void setOrder(List<Order> order) {
		this.order = order;
	}
	public List<Column> getColumns() {
		return columns;
	}
	public void setColumns(List<Column> columns) {
		this.columns = columns;
	}
	public Integer getStart() {
		return start;
	}
	public void setStart(Integer start) {
		this.start = start;
	}
	public Integer getLength() {
		return length;
	}
	public void setLength(Integer length) {
		this.length = length;
	}
}


